module.exports = {

	data() {
		return {
			mpShare: {
				isPrivateMessage: false,
				hideShare: false,
				title: '', // 默认为小程序名称
				path: '', // 默认为当前页面路径
				imageUrl: '' // 默认为当前页面的截图
			}
		}
	},
	onLoad() {
		console.log(this.$api, 3333)
		this.initShare()
	},
	methods: {
		initShare(obj) {
			if (obj) {
				this.mpShare = obj
			}
			if (this.$db.get("userToken")) {

				this.$api.memberInfo({}, res => {
					if (res.code == 200) {
						this.mpShare.path = '/pages/index/index?parentId=' + res.data.id
					}
				})
			}
		},
	},
	onShareAppMessage(e) {
		console.log(e, 1111111)
		return this.mpShare
	},
	// #ifdef MP-WEIXIN
	onShareTimeline() {
		return this.mpShare
	}
	// #endif
}